<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //获取最大和最小范围
/* var age = 18;
var age = 18.8888;
console.log(Number.MAX_VALUE);
console.log(Number.MIN_VALUE); */
       
       
       
//判断确实不是数字
/* var age1 = 1;
var age2 = 'giao';
var age3 = '1';
console.log(isNaN(age1),isNaN(age2),isNaN(age3)); */



        //转义符
/* 
var str1 = '一giao我里giao？';
var str2 = '呀呼';
var str3 = '想加单引号就用这\'个';
var str4 = '想换行就用这\n个';
console.log(str1,str2,str3);
console.log(str4); */


        //看字符串长度
/* var str = '卧虎';
console.log(str.length); */



        //字符串相加,会把其他类型的字符转化为字符串
/* var num = 18;
var zhifu = '丢'
console.log(num + zhifu); */

        //Boolean布尔类型，只有两个值：true false
/*var vlogo = true;
var vlogo2 = false;
console.log(vlogo + 1);//true隐式转换成1   结果为2
console.log(vlogo2 +1);//false隐式转换为0   结果为1 */


        //Undefined
/*  var tt ;
console.log(tt); //输出为：Undefined
console.log(tt + 'giao?');//输出为：Undefinedgiao?
console.log(tt + 11);//输出为：NaN  */

       /*  var a = 'giao'
        var b = 1
        var c = true
        var d 
        var e = null;
        console.log(typeof a);//字符串
        console.log(typeof b);//数值
        console.log(typeof c);//布尔值
        console.log(typeof d);//undefined
        console.log(typeof e);//object (null 在 js 里算作空对象) */
       /*  // tostring()可以把其他类型字符转换成字符串，null和undefined除外
var a = 'giao'
var b = 1
var c = true
var d 
var e = null;
console.log(a.toString());
console.log(b.toString());
console.log(c.toString());
console.log(d.toString());
console.log(e.toString()); */
/*  var a = 'giao'
var b = 1
var c = true
var d 
var e = null;
console.log(String(a));
console.log(String(b));
console.log(String(c));
console.log(String(d));
console.log(String(e));
        //string 也可以转换，但是是全部的都可以转换 */
        // 直接用单引号加也能全部转换，并且简单高效
/* var a = 'giao'
var b = 1
var c = true
var d 
var e = null;
console.log(a + '');
console.log(b + '');
console.log(c + '');
console.log(d + '');
console.log(e + ''); */
    </script> 
</body>
</html>